public class StudentJava {
    // 定义属性
    int id;
    private String name;
    int age;
    String gender;
    String clazz;
    String phoneNum;

    // 构造方法
    public StudentJava(int id, String name, int age, String gender, String clazz) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.clazz = clazz;
    }

    // 重载构造方法
    public StudentJava(int id, String name, int age, String gender, String clazz, String phoneNum) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.clazz = clazz;
        this.phoneNum = phoneNum;
    }

    // 定义方法
    public void printStuInfo() {
        System.out.println(this.id + "," + this.name + "," + this.age + "," + this.gender + "," + this.clazz);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
